package com.neusoft.tijian.mapper;

import com.neusoft.tijian.po.Hospital;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface HospitalMapper {
    //1. hospital/listHospital
    //  ○ 参数：Hospital对象
    //  ○ 返回值：List（泛型：Hospital）
    //  ○ 功能：根据医院状态查询医院列表
    @Select("select * from hospital where state = #{state}")
    public List<Hospital> listHospital(Hospital hospital);
    //2. hospital/getHospitalById
    //  ○ 参数：Hospital对象
    //  ○ 返回值：Hospital对象
    //  ○ 功能：根据医院编号查询医院信息
    @Select("select * from hospital where hpId = #{hpId}")
    public Hospital getHospitalById(Hospital hospital);
    @Select("select rule from hospital where hpId = #{hpId}")
    public List<String> getRuleById(Integer hpId);
}
